<?php
header('Content-Type: application/json');

// 获取 POST 数据
$version = $_POST['version'];
$downloadUrl = $_POST['downloadUrl'];
$updateNotice = $_POST['updateNotice'];
$updateType = $_POST['updateType'];

// 假设更新设置存储在数据库中

include 'config.php';
// 创建连接


// 插入新的更新设置
$sql = "INSERT INTO update_settings (version, download_url, update_notice, update_type) VALUES ('$version', '$downloadUrl', '$updateNotice', '$updateType')";

if ($conn->query($sql) === TRUE) {
    echo json_encode([
        'code' => 200,
        'msg' => '更新设置提交成功'
    ]);
} else {
    echo json_encode([
        'code' => 500,
        'msg' => '更新设置提交失败: ' . $conn->error
    ]);
}

$conn->close();
?>